#define _CRT_SECURE_NO_WARNINGS 1
#include<stdlib.h>
#include<stdio.h>
typedef struct SList
{
	int data;
	struct SList* next;
}SList;

void SListprint(SList* phand)
{
	SList* cur = phand;
	while (cur)
	{
		printf("%d->", cur->data);
		cur = cur->next;
	}
	printf("NULL\n");
}

SList* BuySList(int x)
{
	SList* newnode = (SList*)malloc(sizeof(SList));
	newnode->data = x;
	newnode->next = NULL;
	return newnode;
}
void SListpushAdd(SList** pphand, int val)
{
	SList* cur = *pphand;
	SList* newnode = BuySList(val);
	if (*pphand == NULL)
	{
		*pphand = newnode;
	}
	else
	{
		while (cur->next)
		{
			cur = cur->next;
		}
		cur->next = newnode;

	}
}
void textSList1()
{
	SList *phand = NULL;
	SListpushAdd(&phand, 1);
	SListpushAdd(&phand, 2);
	SListpushAdd(&phand, 3);
	SListpushAdd(&phand, 4);
	SListpushAdd(&phand, 5);
	SListprint(phand);

}

int main()
{
	textSList1();
	return 0;
}